package com.tb.controller;

import com.tb.pojo.College;
import com.tb.pojo.Title;
import com.tb.service.CollegeService;
import com.tb.service.TitleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class TitleController {

    @Autowired
    private TitleService ts;


    @GetMapping("/getTitle")
    public ModelAndView getCollege(ModelAndView mav) {
        List<Title> titleList = ts.findAll();
        mav.addObject("titleList", titleList);
        mav.setViewName("/teacher/information");
        return mav;
    }
}
